<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>Catalago de Obras - Grupo 25: Código-Fonte de consulta.h</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Gerado por Doxygen 1.5.5 -->
<div class="navigation" id="top">
  <div class="tabs">
    <ul>
      <li><a href="index.html"><span>Página&nbsp;Principal</span></a></li>
      <li><a href="annotated.html"><span>Estruturas&nbsp;de&nbsp;Dados</span></a></li>
      <li class="current"><a href="files.html"><span>Arquivos</span></a></li>
    </ul>
  </div>
<h1>consulta.h</h1><a href="consulta_8h.html">Vá para a documentação deste arquivo.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="preprocessor">#include &lt;stdio.h&gt;</span>
<a name="l00002"></a>00002 <span class="preprocessor">#include &lt;stdlib.h&gt;</span>
<a name="l00003"></a>00003 <span class="preprocessor">#include &lt;string.h&gt;</span>
<a name="l00004"></a>00004 <span class="preprocessor">#include &lt;stdio_ext.h&gt;</span> <span class="comment">/* Necessario para a funcao "__fpurge" */</span>
<a name="l00005"></a>00005 <span class="preprocessor">#include &lt;ctype.h&gt;</span> <span class="comment">/* Necessario para a funcao "isdigit" */</span>
<a name="l00006"></a>00006 
<a name="l00007"></a><a class="code" href="consulta_8h.html#4e08e3da16a5821367047709c8f0f2a6">00007</a> <span class="preprocessor">#define tam_titulo 200</span>
<a name="l00008"></a><a class="code" href="consulta_8h.html#f2896e88c6e1bfbb010156b59c446eed">00008</a> <span class="preprocessor"></span><span class="preprocessor">#define tam_tipo 100</span>
<a name="l00009"></a><a class="code" href="consulta_8h.html#0b3318ca3a35e669f78b04ce1bda5e7e">00009</a> <span class="preprocessor"></span><span class="preprocessor">#define tam_autor 125</span>
<a name="l00010"></a><a class="code" href="consulta_8h.html#a52272a387eb8699f37656ee15fe4d27">00010</a> <span class="preprocessor"></span><span class="preprocessor">#define tam_ano 4</span>
<a name="l00011"></a><a class="code" href="consulta_8h.html#de709deea035514b4d90f0f0005430bb">00011</a> <span class="preprocessor"></span><span class="preprocessor">#define tam_valor 12</span>
<a name="l00012"></a><a class="code" href="consulta_8h.html#f82c01d3405340b2545ba6d5593d2ee5">00012</a> <span class="preprocessor"></span><span class="preprocessor">#define tam_imagem 9</span>
<a name="l00013"></a><a class="code" href="consulta_8h.html#63e82776cfea43a18ab091e7d3a01b13">00013</a> <span class="preprocessor"></span><span class="preprocessor">#define tam_total 450</span>
<a name="l00014"></a>00014 <span class="preprocessor"></span>
<a name="l00015"></a><a class="code" href="structNo__PK.html">00015</a> <span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="structNo__PK.html">No_PK</a> {
<a name="l00016"></a><a class="code" href="structNo__PK.html#036ac1667e711e034045e56694bb0bc8">00016</a>         <span class="keywordtype">char</span> <a class="code" href="structNo__PK.html#036ac1667e711e034045e56694bb0bc8">titulo</a>[<a class="code" href="consulta_8h.html#4e08e3da16a5821367047709c8f0f2a6">tam_titulo</a>+1]; <span class="comment">/* estrutura para o arquivo/vetor com as chaves primarias */</span>
<a name="l00017"></a><a class="code" href="structNo__PK.html#8e709669c30740a3a8952ffdefa5bdf3">00017</a>         <span class="keywordtype">int</span> <a class="code" href="structNo__PK.html#8e709669c30740a3a8952ffdefa5bdf3">nrr</a>;
<a name="l00018"></a>00018 } <a class="code" href="structNo__PK.html">No_PK</a>;
<a name="l00019"></a>00019 
<a name="l00020"></a><a class="code" href="consulta_8h.html#805e0b19f7efe51cf8e6194873a38265">00020</a> <span class="keyword">typedef</span> <a class="code" href="structNo__PK.html">No_PK</a> *<a class="code" href="structNo__PK.html">pNo_PK</a>;
<a name="l00021"></a>00021 
<a name="l00022"></a>00022 <span class="comment">/* funcao auxliar para o qsort/bsearch */</span>
<a name="l00023"></a>00023 <span class="keywordtype">int</span> <a class="code" href="consulta_8c.html#c3f135f977e97ce51bde811fe4850fb7">compara</a> (<a class="code" href="structNo__PK.html">pNo_PK</a> obra1, <a class="code" href="structNo__PK.html">pNo_PK</a> obra2 );
<a name="l00024"></a>00024 
<a name="l00025"></a>00025 <span class="comment">/* menu de opcao de consultas */</span>
<a name="l00026"></a>00026 <span class="keywordtype">void</span> <a class="code" href="consulta_8c.html#add007a4d18704a7bbe1971ac81b5364">menu_consulta</a>(<a class="code" href="structNo__PK.html">pNo_PK</a> obras, <span class="keywordtype">int</span> tamanho, <a class="code" href="structNo__PK.html">pNo_PK</a> sk_titulo, <a class="code" href="structNo__PK.html">pNo_PK</a> sk_tipo, <a class="code" href="structNo__PK.html">pNo_PK</a> sk_autor, <a class="code" href="structNo__PK.html">pNo_PK</a> sk_ano, <span class="keywordtype">int</span> ttitulo, <span class="keywordtype">int</span> ttipo, <span class="keywordtype">int</span> tautor, <span class="keywordtype">int</span> tano, <span class="keywordtype">int</span> tam_nrr);
<a name="l00027"></a>00027 
<a name="l00028"></a>00028 <span class="comment">/* funcao que escreve os dados da obra (menos imagem) no arquivo HTML */</span>
<a name="l00029"></a>00029 <span class="keywordtype">int</span> <a class="code" href="consulta_8c.html#cc1c5e3054a7ddb2dc7efd67be869bb0">escreve</a>(FILE *origem, FILE *destino, <span class="keywordtype">char</span> texto[], <span class="keywordtype">int</span> tamanho, <span class="keywordtype">int</span> atual);
<a name="l00030"></a>00030 
<a name="l00031"></a>00031 <span class="comment">/* funcao que faz aparecer a imagem no arquivo HTML */</span>
<a name="l00032"></a>00032 <span class="keywordtype">void</span> <a class="code" href="consulta_8c.html#64145c5100918b6c0cfeb0f521897fef">escreve_img</a>(FILE *origem, FILE *destino, <span class="keywordtype">char</span> texto[], <span class="keywordtype">int</span> tamanho, <span class="keywordtype">int</span> atual);
<a name="l00033"></a>00033 
<a name="l00034"></a>00034 <span class="comment">/* escreve as tags que iniciam o codigo HTML */</span>
<a name="l00035"></a>00035 <span class="keywordtype">void</span> <a class="code" href="consulta_8c.html#16cfbe6d5b5d3280f3e36383eadab7ad">inicio_HTML</a>(FILE *arq);
<a name="l00036"></a>00036 
<a name="l00037"></a>00037 <span class="comment">/* arquivo que coordena a escrita do(s) resultado(s) da busca no arquivo HTML.</span>
<a name="l00038"></a>00038 <span class="comment">        Chama a funcao procura para isso */</span>
<a name="l00039"></a>00039 <span class="keywordtype">void</span> <a class="code" href="consulta_8c.html#e68d4899f52d357d21501d285957cb60">meio_HTML</a> (FILE *resultado, <span class="keywordtype">int</span> nrr);
<a name="l00040"></a>00040 
<a name="l00041"></a>00041 <span class="comment">/* escreve as tags que finalizam o codigo HTML */</span>
<a name="l00042"></a>00042 <span class="keywordtype">void</span> <a class="code" href="consulta_8c.html#3bb21c11aa7c3a2f16e4c558bfdb6e0a">fim_HTML</a> (FILE *arq);
<a name="l00043"></a>00043 
<a name="l00044"></a>00044 <span class="keywordtype">void</span> <a class="code" href="consulta_8c.html#f8370cb3ddb988de92dca1314db5a026">procura_tit</a>(<span class="keywordtype">char</span> *titulo, <a class="code" href="structNo__PK.html">pNo_PK</a> obras, <a class="code" href="structNo__PK.html">pNo_PK</a> SK, <span class="keywordtype">int</span> tamanho, <span class="keywordtype">int</span> tam_nrr);
<a name="l00045"></a>00045 <span class="keywordtype">void</span> <a class="code" href="consulta_8c.html#2974665ec88cd1779f6dcbd6402cea66">procura_tipo</a>(<span class="keywordtype">char</span> *titulo, <a class="code" href="structNo__PK.html">pNo_PK</a> obras, <a class="code" href="structNo__PK.html">pNo_PK</a> SK, <span class="keywordtype">int</span> tamanho, <span class="keywordtype">int</span> tam_nrr);
<a name="l00046"></a>00046 <span class="keywordtype">void</span> <a class="code" href="consulta_8c.html#b4ab26e15edfbbb19de5f9b2f5a7b99b">procura_autor</a>(<span class="keywordtype">char</span> *titulo, <a class="code" href="structNo__PK.html">pNo_PK</a> obras, <a class="code" href="structNo__PK.html">pNo_PK</a> SK, <span class="keywordtype">int</span> tamanho, <span class="keywordtype">int</span> tam_nrr);
<a name="l00047"></a>00047 <span class="keywordtype">void</span> <a class="code" href="consulta_8c.html#699f52652fddf04d22bee4071e6708b4">procura_ano</a>(<span class="keywordtype">char</span> *titulo, <a class="code" href="structNo__PK.html">pNo_PK</a> obras, <a class="code" href="structNo__PK.html">pNo_PK</a> SK, <span class="keywordtype">int</span> tamanho, <span class="keywordtype">int</span> tam_nrr);
<a name="l00048"></a>00048 
<a name="l00049"></a>00049 <span class="comment">/* procura (usando bsearch) um titulo na lista de obras e cria um arquivo HTML com o resultado */</span>
<a name="l00050"></a>00050 <span class="keywordtype">void</span> <a class="code" href="consulta_8c.html#9a40fa0763c3859402d92a2e4e1105e8">procura_aux</a>(<span class="keywordtype">char</span> *titulo, <a class="code" href="structNo__PK.html">pNo_PK</a> obras, <a class="code" href="structNo__PK.html">pNo_PK</a> SK,  <span class="keywordtype">int</span> tamanho, FILE *arquivo, <span class="keywordtype">int</span> tam_nrr);
<a name="l00051"></a>00051 
<a name="l00052"></a>00052 <span class="comment">/* lista todas as obras em um arquivo HTML */</span>
<a name="l00053"></a>00053 <span class="keywordtype">void</span> <a class="code" href="consulta_8c.html#eed00783f1106de6aedbe9426ffbddfa">lista_HTML</a>(<a class="code" href="structNo__PK.html">pNo_PK</a> obras, <span class="keywordtype">int</span> tamanho);
<a name="l00054"></a>00054 
</pre></div></div>
<hr size="1"><address style="text-align: right;"><small>Gerado em Mon Apr 28 16:38:37 2008 para Catalago de Obras - Grupo 25 por&nbsp;
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.5 </small></address>
</body>
</html>
